<ui:composition template="../template/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
	<ui:define name="localizacao">
	<h:outputText value="&#160;" />
	<a href="atualizarUsuario.xhtml"> Perfil</a>
	<h:outputText value="&#160;> Alterar senha" />
	</ui:define>
	<ui:define name="content">
	<p:ajaxStatus style="width:200px;height:200px;position:fixed;right:5px;bottom:5px">
		<f:facet name="start">
			<h:graphicImage value="../public/images/loading45.gif" />
		</f:facet>
		
		<f:facet name="complete">
			<h:outputText value="" />
		</f:facet>
	</p:ajaxStatus>
	<h4>
			<h:outputText value="Alterar Senha" />
		</h4>
		<br />
		<br />
		<h:form id="form_AltSenha">
		<p:messages id="messages" autoUpdate="true" closable="true"/>  
			<table>
				<tr>
					<td><h:outputText value="Senha atual: " /></td>
					<td><p:password id="senhaAntiga" value="#{usuarioMB.senha}"  
								required="true" requiredMessage="Insira a senha atual" style="width: 100%; height: 30px;" /></td>
				</tr>
				<tr>
					<td><h:outputText value="Nova Senha: " /></td>
					<td><p:password id="novaSenha" value="#{usuarioMB.novaSenha}" feedback="true" label="Nova Senha"
								promptLabel="Insira a senha" goodLabel="Boa" weakLabel="Fraca" strongLabel="Forte"
								required="true" requiredMessage="Insira a nova senha" style="width: 100%; height: 30px;" match="r_novaSenha" validatorMessage="Senhas não conferem"/></td>
				</tr>
				<tr>
					<td><h:outputText value="Repetir Nova Senha: " /></td>
					<td><p:password id="r_novaSenha" value="#{usuarioMB.verificacaoSenha}" feedback="true" label="Repetir Senha"
								promptLabel="Insira a senha" goodLabel="Boa" weakLabel="Fraca" strongLabel="Forte"
								  style="width: 100%; height: 30px;" /></td>
				</tr>
				<tr>
					 <td>
					 	<p:commandButton action="#{usuarioMB.alterarSenha()}" update="form_AltSenha"
                        			   value="Alterar" icon="ui-icon-check" styleClass="ui-priority-primary" />
                     </td>

				</tr>
				
			</table>

		</h:form>

	</ui:define>
</ui:composition>